package com.baoyouqun.API.wx;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.Pattern;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

@Data
@ApiModel("新用户微信注册参数")
public class RegisterWechatDTO {

    @NotBlank(message = "微信openid不能为空")
    @ApiModelProperty(value = "微信openid", required = true)
    private String wxOpenid;

    @NotBlank(message = "微信昵称不能为空")
    @ApiModelProperty(value = "微信昵称", required = true, example = "微信用户")
    private String wxName;

    @ApiModelProperty(value = "微信头像URL", example = "https://thirdwx.qlogo.cn/...")
    private String wxAvatar;

    @Pattern(regexp = "^1[3-9]\\d{9}$|^$", message = "手机号格式错误")
    @ApiModelProperty(value = "手机号（可选，需实名时必传）", example = "13800138000")
    private String cellphone;

    @Length(min = 6, max = 6, message = "验证码长度必须为6位")
    @ApiModelProperty(value = "短信验证码（手机号非空时必传）", example = "123456")
    private String smsCode;

    @ApiModelProperty(value = "微信session_key（可选存储）")
    private String wxSessionKey;
}
